home *** CD-ROM | disk | FTP | other *** search
- * MACROS for sources by Kenneth C. Nilsen / Digital Surface
-
- OpenLib MACRO OpenLib Library,Version
- lea \1N(pc),a1
- moveq #\2,d0
- jsr -552(a6)
- move.l d0,\1B
- ENDM
-
- CloseLib MACRO CloseLib Library
- move.l \1B(pc),d0
- beq.b *+8
- move.l d0,a1
- jsr -414(a6)
- ENDM
-
- CloseWin Macro CloseWin <WinBase>
- move.l \1(pc),d0
- beq.b *+8
- move.l d0,a0
- jsr _LVOCloseWindow(a6)
- EndM
-
- CloseScr Macro CloseScr <ScrBase>
- move.l \1(pc),d0
- beq.b *+8
- move.l d0,a0
- jsr _LVOCloseScreen(a6)
- EndM
-
- Base MACRO Base LibN
- move.l \1B(pc),a6
- ENDM
-
- ExecB MACRO move Execbase to a6
- move.l $4.w,a6
- ENDM
-
- Pen MACRO
- moveq #\1,d0
- jsr -78(a6)
- ENDM
-
- StackOn MACRO
- movem.l d2-d7/a2-a6,-(sp)
- ENDM
-
- StackOff MACRO
- movem.l (sp)+,d2-d7/a2-a6
- ENDM
-
- SetPen MACRO SetPen Color
- move.l a5,a1
- moveq #\1,d0
- jsr -342(a6)
- ENDM
-
- Box MACRO Box X1,Y1,X2,Y2
- move.l a5,a1
- move.l \1,d0
- move.l \2,d1
- move.l \3,d2
- move.l \4,d3
- jsr -306(a6)
- ENDM
-
- LineC MACRO LineC X1,Y1,X2,Y2,Color
- move.l a5,a1
- moveq #\5,d0
- jsr -342(a6)
- move.l a5,a1
- move.l \1,d0
- move.l \2,d1
- jsr -240(a6)
- move.l a5,a1
- move.l \3,d0
- move.l \4,d1
- jsr -246(a6)
- ENDM
-
- Line MACRO Line X1,Y1,X2,Y2
- move.l a5,a1
- move.l \1,d0
- move.l \2,d1
- jsr -240(a6)
- move.l a5,a1
- move.l \3,d0
- move.l \4,d1
- jsr -246(a6)
- ENDM
-
- LineW MACRO LineW X1,Y1,X2,Y2
- move.l a5,a1
- move.w \1,d0
- move.w \2,d1
- jsr -240(a6)
- move.l a5,a1
- move.w \3,d0
- move.w \4,d1
- jsr -246(a6)
- ENDM
-
- DCall MACRO
- jsr _LVODF\1(a6)
- ENDM
-
- Call MACRO
- jsr _LVO\1(a6)
- ENDM
-
- PrtCmd MACRO
- move.l #PRTCMD_\1,d0
- ; jsr LVODF_PrintComand(a6)
- ENDM
-
- ;These macros will make BarFly sources compatible wih other assemblers:
-
- MB MACRO
- move.b \1,\2
- ENDM
-
- MW MACRO
- move.w \1,\2
- ENDM
-
- ML MACRO
- move.l \1,\2
- ENDM
-
- MQ MACRO
- moveq \1,\2
- ENDM
-
- WaitID MACRO ;WaitID Gadgetlist
- move.l Rast(pc),a0
- move.l Port(pc),a1
- lea \1(pc),a2
- DCall WaitGad
- lea \1(pc),a1
- DCall getID
- ENDM
-
- TestID MACRO ;TestID [n],[label]
- cmp.b #\1,d0
- beq \2
- ENDM
-
- Render MACRO ;Render [gadgets]
- move.l Rast(pc),a0
- lea \1(pc),a1
- DCall RenderGadgets
- ENDM
-
- Gadget MACRO ;Gadget x,y,w,h,id,title,colors,flags,font
- dc.w \1,\2,\3,\4,\5
- dc.l \6,0,0,0,\7,\8,\9,0
- ENDM
-
- Hold MACRO
- .hold btst #6,$bfe001
- bne.b .hold
- ENDM
-
- DUMPSTRING MACRO ;DUMPSTRING "String",LabelID NB: labID must be UNIC!
-
- IFD DODUMP ;in source: DODUMP SET 1 to enable debug dump
-
- movem.l d0-d7/a0-a6,-(sp)
-
- move.l $4.w,a6
- moveq #0,d0
- lea .debLibName\2(pc),a1
- jsr -552(a6) ;open dos.library version 0
- tst.l d0
- beq.b .debEnd\2
-
- move.l d0,a6
- jsr -60(a6) ;default output handler
- move.l d0,d1
- beq.b .close\2
-
- move.l #.string\2,d2
- move.l #.stringSize\2,d3
- jsr -48(a6) ;write string to handler
-
- .close\2 lea (a6),a1
- move.l $4.w,a6
- jsr -414(a6) ;close dos.library again
-
- bra.b .debEnd\2
-
- .debLibName\2 dc.b "dos.library",0
- .string\2 dc.b "DEBUG DUMP: ",27,"[1m",\1,27,"[0m",10
- .stringSize\2 = *-.string\2
- even
-
- .debEnd\2 movem.l (sp)+,d0-d7/a0-a6
-
- ENDC
-
- ENDM
-
- Blink MACRO
- move.w #$fff,$dff180
- move.w #$fff,$dff180
- move.w #$fff,$dff180
- move.w #$fff,$dff180
- move.w #$fff,$dff180
- ENDM
-